﻿<UserControl x:Class="MenuBarModule.MenuBar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
             xmlns:local="clr-namespace:MenuBarModule.ViewModels">
    <UserControl.Resources>
        
    </UserControl.Resources>
    <Grid>

        <Menu Name="menu" DockPanel.Dock="Top" ItemsSource="{Binding MenuItems}">
            <Menu.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
                    <TextBlock Margin="1" Text="{Binding Text}"/>
                    <HierarchicalDataTemplate.ItemContainerStyle>
                        <Style TargetType="MenuItem">
                            <Setter Property="Command" Value="{Binding Command}" />
                        </Style>
                    </HierarchicalDataTemplate.ItemContainerStyle>
                    <HierarchicalDataTemplate.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Margin="1" Text="{Binding Text}"/>
                        </DataTemplate>
                    </HierarchicalDataTemplate.ItemTemplate>
                </HierarchicalDataTemplate>
            </Menu.ItemTemplate>
        </Menu>



    </Grid>
</UserControl>
